import { Component, OnInit } from '@angular/core';
import { CommunicateService } from '../communicate.service';

@Component({
  selector: 'app-son2',
  templateUrl: './son2.component.html',
  styleUrls: ['./son2.component.less']
})
export class Son2Component implements OnInit {
  sname = '默认名字';
  constructor(private cs: CommunicateService) { }

  ngOnInit() {


    this.cs.ob.subscribe(str => {
      this.sname = '其他兄弟发来了消息' + str;

    });
  }

}
